Public Class CScheme
    Private intSchemeID As Integer
    Private intItemID As Integer
    Private chSchemeType As Char
    Private dtValidFrom As Date
    Private dtValidTo As Date
    Private intSchemeMinQty1 As Integer
    Private intSchemeFreeQty1 As Integer
    Private intSchemeMinQty2 As Integer
    Private intSchemeFreeQty2 As Integer
    Private intSchemeMinQty3 As Integer
    Private intSchemeFreeQty3 As Integer
    Private chDiscountType As Char
    Private dblDiscount As Double
    Private dblDiscountAmount As Double

    '@20071127:Add following line
    Private chApllyTo As Char
    Private intSchemeItemID As Integer
    Private strRemarks As String
    Private strBuyerCd As String
    Private strSellerCd As String


    Public Sub New()
        intSchemeID = 0
        intItemID = 0
    End Sub

    Public Property SchemeID() As Integer
        Get
            Return intSchemeID
        End Get
        Set(ByVal value As Integer)
            intSchemeID = value
        End Set
    End Property
    Public Property ItemID() As Integer
        Get
            Return intItemID
        End Get
        Set(ByVal value As Integer)
            intItemID = value
        End Set
    End Property

    Public Property SchemeType() As Char
        Get
            Return chSchemeType
        End Get
        Set(ByVal value As Char)
            chSchemeType = value
        End Set
    End Property



    Public Property ValidFrom() As Date
        Get
            Return dtValidFrom
        End Get
        Set(ByVal value As Date)
            dtValidFrom = value
        End Set
    End Property
    Public Property ValidTo() As Date
        Get
            Return dtValidTo
        End Get
        Set(ByVal value As Date)
            dtValidTo = value
        End Set
    End Property

    Public Property SchemeMinQty1() As Integer
        Get
            Return intSchemeMinQty1
        End Get
        Set(ByVal value As Integer)
            intSchemeMinQty1 = value
        End Set
    End Property
    Public Property SchemeFreeQty1() As Integer
        Get
            Return intSchemeFreeQty1
        End Get
        Set(ByVal value As Integer)
            intSchemeFreeQty1 = value
        End Set
    End Property
    Public Property SchemeMinQty2() As Integer
        Get
            Return intSchemeMinQty2
        End Get
        Set(ByVal value As Integer)
            intSchemeMinQty2 = value
        End Set
    End Property

    Public Property SchemeFreeQty2() As Integer
        Get
            Return intSchemeFreeQty2
        End Get
        Set(ByVal value As Integer)
            intSchemeFreeQty2 = value
        End Set
    End Property

    Public Property SchemeMinQty3() As Integer
        Get
            Return intSchemeMinQty3
        End Get
        Set(ByVal value As Integer)
            intSchemeMinQty3 = value
        End Set
    End Property
    Public Property SchemeFreeQty3() As Integer
        Get
            Return intSchemeFreeQty3
        End Get
        Set(ByVal value As Integer)
            intSchemeFreeQty3 = value
        End Set
    End Property
    Public Property DiscountType() As Char
        Get
            Return chDiscountType
        End Get
        Set(ByVal value As Char)
            chDiscountType = value
        End Set
    End Property
    '@20071127:Add following line
    Public Property ApllyTo() As Char
        Get
            Return chApllyTo
        End Get
        Set(ByVal value As Char)
            chApllyTo = value
        End Set
    End Property
    Public Property DiscountAmount() As Double
        Get
            Return dblDiscountAmount
        End Get
        Set(ByVal value As Double)
            dblDiscountAmount = value
        End Set
    End Property


    Public Property Discount() As Double
        Get
            Return dblDiscount
        End Get
        Set(ByVal value As Double)
            dblDiscount = value
        End Set
    End Property
    Public Property schemeItemID() As Integer
        Get
            Return intSchemeItemID
        End Get
        Set(ByVal value As Integer)
            intSchemeItemID = value
        End Set
    End Property
    Public Property remarks() As String
        Get
            Return strRemarks
        End Get
        Set(ByVal value As String)
            strRemarks = value
        End Set
    End Property
    Public Property BuyerCategoryID() As String
        Get
            Return strBuyerCd
        End Get
        Set(ByVal value As String)
            strBuyerCd = value
        End Set
    End Property

    Public Property SellerCategoryID() As String
        Get
            Return strSellerCd
        End Get
        Set(ByVal value As String)
            strSellerCd = value
        End Set
    End Property

    Public ReadOnly Property GetSchemeName() As String
        Get
            Dim strScheme As String = String.Empty
            If intSchemeID > 0 Then

                If chSchemeType = "D" Then
                    If chDiscountType = "A" Then
                        strScheme = dblDiscount.ToString() & " RS.Off"
                    ElseIf DiscountType = "P" Then
                        strScheme = dblDiscount.ToString() & "% Off"
                    End If
                ElseIf chSchemeType = "F" Then

                End If
            End If
            Return strScheme
        End Get
    End Property

End Class
